package com.el;

import java.io.IOException;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.e.DBManager;
import com.e.QueryDataResult;
import com.e.User;

/**
 * Servlet implementation class UserServlet
 */
public class UserServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public UserServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see Servlet#init(ServletConfig)
	 */
	public void init(ServletConfig config) throws ServletException {
		// TODO Auto-generated method stub
	}

	/**
	 * @see Servlet#destroy()
	 */
	public void destroy() {
		// TODO Auto-generated method stub
	}

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		//response.getWriter().append("Served at: ").append(request.getContextPath());
		
		ArrayList<User1> list = new ArrayList<User1>();
		list.add(new User1(1001, "赵俊岭", "2000-01-01", "男",4110001,"18336141673"));
		list.add(new User1(1002, "李万胜", "2000-01-01", "男",4110002,"111111111111"));
		list.add(new User1(1003, "杜冰冰", "2000-01-01", "女",4110003,"111111111111"));
		list.add(new User1(1004, "郝博", "2000-01-01", "男",4110004,"111111111111"));
		list.add(new User1(1005, "杨廷辉", "2000-01-01", "男",4110005,"111111111111"));
			 request.setAttribute("us", list); 
		     request.getRequestDispatcher("userList1.jsp").forward(request, response); 
		
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
